package com.fita.admin.dao;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Limit;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.fita.entity.data.VehicleParameter;

import java.util.List;

/**
 * 
 * @author cuteHU
 *
 */
@Dao("hibernate")
public interface VehicleParameterDao {

    /**
     * @return
     */
    @Query("SELECT COUNT(*) FROM VehicleParameter")
    public int count();

    @Limit
    @Query("FROM VehicleParameter")
    public List<VehicleParameter> listByPage(@Variable("beginIndex") int beginIndex,
            @Variable("maxResult") int maxResult);

    /**
     * 
     * @param englishName
     * @return
     */
    @Query("FROM VehicleParameter WHERE disabled = false AND englishName = :englishName")
    public VehicleParameter load(@Variable("englishName") String englishName);

    /**
     * @param englishName
     * @return
     */
    @Query("FROM VehicleParameter WHERE englishName =:englishName")
    public List<VehicleParameter> loads(@Variable("englishName") String englishName);
}
